home *** CD-ROM | disk | FTP | other *** search
/ 3D Games (Spidla) / 3dhry2.iso / Cube Drop 2001 1.0 / src / Matrix.h < prev   
Encoding:
C/C++ Source or Header  |  2003-03-17  |  930 b   |  56 lines

  1. #ifndef MATRIX_H
  2. #define MATRIX_H
  3.  
  4. #ifdef WIN32
  5. #include "windows.h"
  6. #endif
  7.  
  8. #include <GL/gl.h>
  9. #include <GL/glu.h>
  10. #include <GL/glut.h>
  11. #include <GL/glaux.h>
  12. #include <stdlib.h>
  13. #include <time.h>
  14. #include <stdio.h>
  15.  
  16.  
  17. #define MAT_WIDTH 5
  18. #define MAT_HEIGHT 10
  19. #define MAT_DEPTH 5
  20.  
  21. struct MatrixLocation
  22. {
  23.     int x;
  24.     int y;
  25.     int z;
  26. };
  27.  
  28. class Matrix
  29. {
  30.     private:
  31.         int loc[MAT_WIDTH][MAT_HEIGHT][MAT_DEPTH];
  32.         // active cube matrix location
  33.         MatrixLocation activeCube;
  34.         int score;
  35.         
  36.     public:
  37.         Matrix();        
  38.         int isSet(int,int,int);
  39.         void set(int,int,int);
  40.         bool moveDown();
  41.         bool drop();
  42.         void moveLeft();
  43.         void moveRight();
  44.         void moveOut();
  45.         void moveIn();
  46.         void setActiveCube(int, int, int);
  47.         void clearRows();
  48.         void lowerFloaters(char);
  49.         void SetTitleBar();
  50.         int GetScore() { return score; }
  51.         void SetScore(int s) { score = s; }
  52.         void ZeroMatrix();
  53. };
  54.  
  55.  
  56. #endif